import Taro from '@tarojs/taro'

import {baseUrl} from '../constants/url'

export const getSort = (parent_sort_id) => {
  const result = Taro.request({
    url:baseUrl+'api/sort/getSort',
    method:'GET',
    data:{parent_sort_id:parent_sort_id==undefined?'':parent_sort_id}
  })
  return result
}

export const getSortBlog = (sort_id) => {
  const result = Taro.request({
    url:baseUrl+'api/sort/getBlog',
    method:'GET',
    data:{sort_id}
  })
  return result
}

export const setSort = (sort_id,blog_id) => {
  const result = Taro.request({
    url:baseUrl+'api/sort/setSort',
    method:'POST',
    data:{sort_id,blog_id}
  })
  return result
}